package day1020_3;

public class E4 {
    public static void main(String[] args) {
        int[]  as={2, 10,  5  , 0};
        try{
            System.out.println(5/as[3]);
            System.out.println(as[15]);
        }catch(ArithmeticException a){//子类型异常
            System.out.println("出现了数学运算异常");
        }catch(ArrayIndexOutOfBoundsException aoo){
            System.out.println("出现了ArrayIndexOutOfBoundsException");
        }catch(Exception aoo){
            System.out.println("出现了ArrayIndexOutOfBoundsException");
        }
        //多个catch处理异常时：  父类型异常catch写到后边，子类型异常catch写到前边
    }
}
